SYSCONF_LINK = g++
CPPFLAGS     = -O3 -std=c++17
LDFLAGS      = -O3 -std=c++17
LIBS         = -lm

DESTDIR = ./
TARGET  = main


OBJECTS := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
OBJECTS += $(patsubst %.cpp,%.o,$(wildcard ../utils/*.cpp))

all: $(DESTDIR)$(TARGET) 

$(DESTDIR)$(TARGET): $(OBJECTS)
	$(SYSCONF_LINK) -Wall $(LDFLAGS) -o $(DESTDIR)$(TARGET) $(OBJECTS) $(LIBS) 

$(OBJECTS): %.o: %.cpp
	$(SYSCONF_LINK) -Wall $(CPPFLAGS) -c $(CFLAGS) $< -o $@


.PHONY: clean
clean:
#	-rm -f $(OBJECTS)
#	-rm -f $(TARGET)
#	-rm -f *.tga
#	Window
	-del  .\main.o
	-del  ..\utils\*.o
	-del  $(TARGET).exe
